import {service, serviceWidget, httpJsonp} from '@/utils/http';

export function getMessageCode(data: any) {
    return service({ url: '/getMessageCode.json', method: 'get', params: data })
};
export function checkMessageCode(data: any) {
    return service({ url: '/checkMessageCode.json', method: 'get', params: data })
}

export function submitWithWeCom(data: any) {
    return service({ url: '/potential/submitAndVerifyWithWeCom.do', method: 'post', headers: { "content-type": "application/x-www-form-urlencoded" }, data: data })
}

export function getMore(data: any) {
    return service({ url: "/potential/queryFormConfiguration.do", method: "get", params: data })
}

export function getEnumData(data: any) {
    const url = process.env.NODE_ENV === 'development' ? '/widget/front/getJsonComponent.json' : "https://widget.1688.com/front/getJsonComponent.json"
    // return serviceWidget({ url: "/front/getJsonComponent.json", method: "get", params: data })
    return httpJsonp(url, data)
}